package com.cgbl.cg.adapter

import com.blankj.utilcode.util.TimeUtils
import com.cgbl.cg.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.robot.base.model.CommentBean
import com.robot.base.utils.pic.ImageLoaderUtils

class WorkCommentAdapter :
    BaseQuickAdapter<CommentBean, BaseViewHolder>(R.layout.app_item_work_commenct) {
    override fun convert(holder: BaseViewHolder, item: CommentBean) {
        holder.setText(R.id.item_tv_name, item.fromNickName)
            .setText(R.id.item_tv_time, TimeUtils.millis2String((item.createTime ?: 0L)))
            .setText(R.id.item_tv_content, item.content)
        ImageLoaderUtils.displayCirclePortrait(
            context,
            holder.getView(R.id.item_iv_avatar),
            item.fromAvatar
        )
//        if(!item.commentList.isNullOrEmpty()){
//            val mRv = holder.getView<RecyclerView>(R.id.item_mRv)
//            val workCommentAdapter = WorkCommentChildAdapter()
//            mRv.adapter = workCommentAdapter
//            workCommentAdapter.setNewInstance(item.commentList as MutableList<WorkCommentBean.WorkCommentChildBean>?)
//        }
    }
}